package com.hospital.diagnosis.module.mapper;

import com.hospital.common.pojo.*;
import com.hospital.diagnosis.module.vo.DiagnosisRecordTitleVo;
import com.hospital.diagnosis.module.vo.DiagnosisVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DiagnosisRecordMapper
{
    List<DiagnosisRecordTitleVo> getDiagnosisRecordListByPatientId(@Param("patientId") Long patientId,
                                                                   @Param("startRow") Integer startRow,
                                                                   @Param("pageSize") Integer pageSize);

    Integer getDiagnosisRecordCountByPatientId(@Param("patientId") Long patientId);

    List<DiagnosisRecordTitleVo> getDiagnosisRecordListByDoctorId(@Param("doctorId") Long doctorId,
                                                                  @Param("startRow") Integer startRow,
                                                                  @Param("pageSize") Integer pageSize);

    Integer getDiagnosisRecordCountByDoctorId(@Param("doctorId") Long doctorId);

    List<TDiagnosisRecord> getDiagnosisRecordById(@Param("id") Long id);

    List<TUser> getUserById(@Param("userId") Long userId);

    List<TPatientInfo> getPatientInfoById(@Param("infoId") Long infoId);

    List<TDoctorInfo> getDoctorInfoById(@Param("infoId") Long infoId);

    Integer addDiagnosisRecord(TDiagnosisRecord tDiagnosisRecord);

    Integer addDiagnosisApplication(TDiagnosis tDiagnosis);

    List<DiagnosisVo> getDiagnosisApplicationByPatientId(@Param("patientId") Long patientId,
                                                         @Param("doctorName") String doctorName,
                                                         @Param("startTime") String startTime,
                                                         @Param("endTime") String endTime,
                                                         @Param("startRow") Integer startRow,
                                                         @Param("pageSize") Integer pageSize);

    Integer getDiagnosisApplicationCountByPatientId(@Param("patientId") Long patientId,
                                                    @Param("doctorName") String doctorName,
                                                    @Param("startTime") String startTime,
                                                    @Param("endTime") String endTime);

    Integer getDiagnosisRecordCountByName(@Param("patientId") Long patientId,
                                          @Param("doctorId") Long doctorId,
                                          @Param("patientName") String patientName,
                                          @Param("doctorName") String doctorName,
                                          @Param("startTime") String startTime,
                                          @Param("endTime") String endTime);

    List<DiagnosisRecordTitleVo> getDiagnosisRecordListByName(@Param("patientId") Long patientId,
                                                              @Param("doctorId") Long doctorId,
                                                              @Param("patientName") String patientName,
                                                              @Param("doctorName") String doctorName,
                                                              @Param("startTime") String startTime,
                                                              @Param("endTime") String endTime,
                                                              @Param("startRow") Integer startRow,
                                                              @Param("pageSize") Integer pageSize);
}
